<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
	<head>
		<title>jQuery Event Key</title>
        <style type='text/css'>
            body {font-family: verdana}
        </style>
	</head>
	<body>
<div id='demo-html'>
<label for='key'>Type in input:</label><input id='key' /> 
<div>Keydown:<span id='keydown'></span></div>
<div>Keypress:<span id='keypress'></span></div>
<div>Keyup:<span id='keyup'></span></div>
</div>
<script type='text/javascript' src='../../node_modules/steal/steal.js' main='@empty'></script>
</script>
<script id="demo-source" type='text/javascript'>
  steal('jquerypp/event/key',function(){
		var readable = {
			"\r" : "\\r",
			"\b" : "\\b",
			"\t" : "\\t"
		};

		$('#key').on('keydown keypress keyup', function(ev){
      var key = ev.keyName();
      $("#"+ev.type).html(readable[key] || key + ' (' + ev.keyCode + ', ' + ev.charCode + ', ' + ev.which + ')')
    });
  });
</script>
	</body>
</html>